<?php

class BaseDatos{

    var $host;
    var $user;
    var $password;

    public function  __construct($ihost, $iuser, $ipassword) {
        $this->host = $ihost;
        $this->user = $iuser;
        $this->password = $ipassword;
    }

    public function conectar(){

        mysql_connect ($this->host, $this->user, $this->password) or die("Problema al tratar de conectar");
        echo "Conexion exitosa!";        
    }

    public function seleccionarBD($db){

        mysql_select_db ($db) or die("No fue posible seleccionar bd");
        echo "Base de datos seleccionada!";
    }
}


//$connect = new BaseDatos("localhost", "root", "root");
//$connect->conectar();
//$connect->seleccionarBD("phplogin");

?>
